package com.codi.base.exception;

import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * BaseException
 *
 * @author shi.pengyan
 * @version 1.0 2017-09-25 15:17
 * @since 1.0
 */
@ToString
@Data
@Accessors(chain = true)
public class BaseException extends RuntimeException {

    private int    errorCode;
    private String errorType;// 默认为应用错误，
    private String errorMessage;

    public BaseException() {
        super();
    }

    public BaseException(Integer errorCode) {
        this(errorCode, null, null);
    }

    public BaseException(Integer errorCode, String errorMessage) {
        this(errorCode, null, errorMessage);
    }


    public BaseException(Integer errorCode, String errorType, String errorMessage) {
        this.errorCode = errorCode;
        this.errorType = errorType;
        this.errorMessage = errorMessage;
    }
}
